package br.xraylol.test.client;

import static org.junit.Assert.assertNotNull;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import br.xraylol.bean.riot.TeamBean;
import br.xraylol.client.TeamClient;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring-module.xml")
public class TeamTestClient {
	
	@Autowired
	TeamClient client;
	
	@Test
	public void findSummoners() {
		List<TeamBean> summonerTeams = client.findTeamBySummonerId(2000861L);
		
		assertNotNull(summonerTeams);
	}
	
	@Test
	public void findTeams() {
		HashMap<String, TeamBean> teams = client.findTeams(getIds());
		
		assertNotNull(teams);
	}
	
	private List<String> getIds() {
		List<String> ids = new ArrayList<String>();
		ids.add("TEAM-a2422690-5719-11e3-883f-d4ae528a516a");
		ids.add("TEAM-d619e9d0-a66f-11e3-ae4e-d4ae527988fc");
		
		return ids;
	}
}
